//
//  HomeTypeCell2.m
//  WanCaiC8
//
//  Created by 罗先森 on 2018/8/20.
//  Copyright © 2018年 tangang. All rights reserved.
//

#import "HomeTypeCell2.h"
@interface HomeTypeCell2()
@end

@implementation HomeTypeCell2{

    UIImageView *icon;
    QXLable     *titleLabel;
    QXLable     *detailLabel;
    UIView      *line1;
    UIView      *line2;
}

- (instancetype)initWithFrame:(CGRect)frame{
    if (self=[super initWithFrame:frame]) {
        
        [self setupUI];
    }
    return self;
}

-(void)setupUI{
    WS(weakSelf);
    icon=[[UIImageView alloc]init];
    self.contentView.backgroundColor=[UIColor whiteColor];
    [self.contentView addSubview:icon];
    [icon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(weakSelf.contentView);
        make.left.equalTo(weakSelf.contentView).offset(10);
        make.size.mas_equalTo(CGSizeMake(real_size(42), real_size(42)));
    }];
    
    titleLabel=[[QXLable alloc]initTitle];
    titleLabel.textAlignment=NSTextAlignmentCenter;
    [self.contentView addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(icon.mas_right).offset(10);
        make.top.equalTo(icon);
    }];
    
    detailLabel=[[QXLable alloc]init];
    detailLabel.textAlignment=NSTextAlignmentCenter;
    [self.contentView addSubview:detailLabel];
    [detailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(titleLabel);
        make.top.equalTo(titleLabel.mas_bottom).offset(5);
    }];
    
    
    line1=[[UIView alloc]init];
    line1.backgroundColor=DEFAULTBGCOLOR;
    [self.contentView addSubview:line1];
    [line1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.equalTo(self.contentView);
        make.height.mas_equalTo(@.7);
    }];

    line2=[[UIView alloc]init];
    line2.backgroundColor=DEFAULTBGCOLOR;
    [self.contentView addSubview:line2];
    [line2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.right.bottom.equalTo(self.contentView);
        make.width.mas_equalTo(@.7);
    }];
}



- (void)setModel:(LotteryNavModel *)model{

    titleLabel.text=model.LTypeName;
    detailLabel.text = model.OpenTip;
    
    NSURL *url=[NSURL URLWithString:model.Logo];
    [icon sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"chat_icon"]];
    
}



@end
